package top.kangyaocoding.tech.config;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.memory.ChatMemory;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import top.kangyaocoding.tech.common.redis.RedissonService;
import top.kangyaocoding.tech.common.utils.ChatRedisMemory;

/**
 * 描述:
 *
 * @author K·Herbert
 * @since 2025-04-16 12:29
 */
@Configuration
public class ChatConfig {

    private final ChatModel chatModel;
    private final RedissonService redissonService;

    public ChatConfig(ChatModel chatModel, RedissonService redissonService) {
        this.chatModel = chatModel;
        this.redissonService = redissonService;
    }

    @Bean
    public ChatClient chatClient(ChatMemory chatMemory) {
        return ChatClient.builder(chatModel)
                .defaultSystem("你好")
                .build();
    }
}